package thermologic.core;

import java.io.Serializable;
import java.util.Date;


/**
 * A sample consists of
 * a record with timestamp and value
 * 
 * @author Mauricio
 */
public class Sample implements Serializable
{
    /**
     * Timestamp
     */
    private Date timeStamp;
    
    /**
     * Value
     */
    private double value;
    
    public Sample(Date timeStamp, double value)
    {
        setTimeStamp(timeStamp);
        setValue(value);
    }

    /**
     * @return the timeStamp of sample
     */
    public Date getTimeStamp()
    {
        return timeStamp;
    }
    
    /**
     * Sets the timeStamp of sample
     * 
     * @param timeStamp
     */
    protected void setTimeStamp(Date timeStamp)
    {
        if(timeStamp == null)
        {
            throw new IllegalArgumentException("timeStamp is null");
        }
        this.timeStamp = timeStamp;
    }

    /**     
     * @return the value of sample
     */
    public double getValue()
    {
        return value;
    }

    /**
     * Sets the value of sample
     * @param value
     */
    protected void setValue(double value)
    {
        this.value = value;
    }
}
